<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<button onclick=testClose(event);>点击</button>
</body>

<script src="static/js/jquery-3.3.1.js" type="text/javascript"></script>
<script type="text/javascript">

//页面关闭时调用
/* $(window).unload(function()
{
    storeChange();
}); */

//页面刷新时调用
$(window).on('beforeunload', function(event) {
	 console.log("页面先刷新");
    storeChange();
});

//前端页面内容修改触发
function haveModified()
{
    //做一些事情

    storeChange();
} 

function storeChange()
{
    //做一些事情
	alert("Hello");
    $.ajax({
        type:"POST",
        dataType:"json",
        data:{projectId:projectId,projectLists:arrProjectNodes},
        url:'Project/Project/modifyProject',
        success:function (data) {
            if (data.errno == 0) {
                //do something 
            } else {
                console.log('there are some errors in project.js:storeChange ajax' + data.errno + ': ' + data.msg);
            }
        },
        error:function (er) {
            console.log('some error in project.js:storeChange ajax');
        }
    });
}

	
</script>
</html>